package com.demo.wormhole.component.mock;

import com.demo.wormhole.component.mock.annotation.WormholeMock;
import com.demo.wormhole.component.mock.exception.WormholeMockRuntimeExpetion;
import com.demo.wormhole.core.context.WormholeContextHolder;

public interface WormholeMockCallback {
    
    public void init(WormholeMock wormholeMock);
    
    public Object handelMockData(Object[] parameter);
    
    public boolean verify(Object[] parameter);
    
    public Object success(Object[] parameter);
    
    public default Object fail(Object[] parameter) {
        String key = WormholeContextHolder.getProperty(null);
        throw new WormholeMockRuntimeExpetion("Mock invok fail method,WormholeContext:[" + key + "] ...", 9999);
    }
}
